<div class="form">
 <?php if(Yii::app()->user->hasFlash('success')){?>
  <div class="flash-success" style="color:black;background-color:#FFFF67;">
      <?php echo Yii::app()->user->getFlash('success');?>
</div>
<?php } ?>

<?php $form=$this->beginWidget('CActiveForm', array(
	'id'=>'quiz-form',
	'enableAjaxValidation'=>false,
)); ?>
<?php $objects = Category::model()->findAll();
$arr = array();
foreach ($objects as $obj) {
     $arr[$obj->id] = $obj->name;
}?>


	<p class="note">Fields with <span class="required">*</span> are required.</p>

	<?php echo $form->errorSummary($model); ?>

	<div class="row">
		<?php echo $form->labelEx($model,'category_id'); ?>
	<?php if(!empty($_GET['id']))
{
	$id=$_GET['id'];
}
	else 
	$id="";
?>
		<?php echo $form->dropDownList($model,'category_id',$arr,array('empty'=>'select quiz', 'options'=>array($id=>array('selected'=>'selected')))); ?>
		<?php echo $form->error($model,'category_id'); ?>
	</div>
	
	<div class="row" align="justify">
		<a href="<?php echo Yii::app()->createUrl('/admin/category/create')?>"><b><u>Create You Category here</u></b></b></a>
	</div>
	<div class="row">&nbsp;&nbsp;&nbsp;</div>

	<div class="row">
		<?php echo $form->labelEx($model,'title'); ?>
		<?php echo $form->textField($model,'title',array('size'=>60,'maxlength'=>200)); ?>
		<?php echo $form->error($model,'title'); ?>
	</div>

	<div class="row">
		<?php echo $form->labelEx($model,'description'); ?>
		<?php echo $form->textArea($model,'description',array('rows'=>6, 'cols'=>50)); ?>
		<?php echo $form->error($model,'description'); ?>
	</div>

	

	<div class="row">
		<?php echo $form->labelEx($model,'no_of_level'); ?>
		<?php echo $form->textField($model,'no_of_level'); ?>
		<?php echo $form->error($model,'no_of_level'); ?>
	</div>

	<div class="row">
		<?php echo $form->labelEx($model,'no_of_questions'); ?>
		<?php echo $form->textField($model,'no_of_questions'); ?>
		<?php echo $form->error($model,'no_of_questions'); ?>
	</div>

	<div class="row">
		<?php echo $form->labelEx($model,'passing_percentage'); ?>
		<?php echo $form->textField($model,'passing_percentage'); ?>
		<?php echo $form->error($model,'passing_percentage'); ?>
	</div>
	
	<div class="row">
		<?php echo $form->labelEx($model,'time'); ?>
	
		 <?php echo $form->dropDownList($model,'time', array('empty'=>'slect time limit','5'=>'5min','10'=>'10min','15'=>'15min','20'=>'20min','25'=>'25min','30'=>'30min','35'=>'35min','40'=>'40min','45'=>'45min','50'=>'50min','55'=>'55min','60'=>'60min')); ?>
	
		<?php echo $form->error($model,'time'); ?>
	</div>

	<div class="row">
		<?php echo $form->labelEx($model,'status'); ?>
		 <?php echo $form->dropDownList($model,'status', array('draft'=>'draft','published'=>'published')); ?>
		<?php echo $form->error($model,'status'); ?>
	</div>

	
	<div class="row buttons">
		<?php echo CHtml::submitButton($model->isNewRecord ? 'Create' : 'Save'); ?>
	</div>

<?php $this->endWidget(); ?>

</div><!-- form -->